#delimit;
clear;
set more off;
capture log close;
set more off;

/*****
CHANGE PATH
*****/;
local path2 "/data";
local pathtab "/data";

use "`path2'/age1997_2004.dta", clear;  

rename age_TU_2004_alt_hat age;

gen age_floor=floor(age);
gen dob_y=2004-age_floor;
gen monthdays=age-age_floor;
gen month=monthdays*12;
gen dob_m=12-floor(month);

gen dob=mdy(dob_m,15,dob_y);
format dob %td;

rename age age_2004;
keep pid dob age_2004 dob_y dob_m;
sort pid;
save "`pathtab'/age_tomerge.dta", replace;
